.lightbox {
    @include lightbox;
    h2 {
        @include font-size(xlarge);
        @include font-type(regular);
    }
}

.lightbox-generic-form {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }

    fieldset {
        position: relative;
    }

    textarea {
        min-height: 4.5rem;
        resize: vertical;
    }

    .existing-or-new-selector {
        display: flex;
        margin-bottom: 2rem;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                transition: background .2s ease-in;
            }
            &:checked+label:hover {
                background: $primary-light;
            }
            +label {
                background: rgba($whitish, .7);
                cursor: pointer;
                display: block;
                font-size: 1em;
                padding: 2rem 1rem;
                text-align: center;
                text-transform: uppercase;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: rgba($primary-light, .3);
                transition: background .2s ease-in;
            }
        }
        .existing-or-new-selector-single {
            flex: 1;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }

    .tags-block {
        width: 100%;
        .tags-container {
            align-items: center;
            column-gap: .5rem;
            display: flex;
            flex-wrap: wrap;
            row-gap: .5rem;
        }
        .tag {
            align-items: center;
            display: flex;
            font-size: .875rem;
            min-height: 2rem;
            &:first-child {
                margin-inline-start: 0;
            }
        }
    }

    .settings {
        display: flex;
        justify-content: center;
        fieldset {
            margin-right: .5rem;
            &:hover {
                color: $white;
                transition: all .2s ease-in;
                transition-delay: .2s;
            }
            &:last-child {
                margin: 0;
            }
        }
        .requirement,
        .iocaine {
            vertical-align: middle;
            &:hover {
                background: $primary-light;
                border: 1px solid $color-link-primary;
            }
            svg {
                @include svg-size(.75rem);
            }
        }

        .blocked {
            &:hover {
                background: $red-light;
                border: 1px solid $red;
            }
        }
        .client-requirement,
        .team-requirement,
        .iocaine-flag {
            input:checked+label {
                background: $color-link-primary;
                border: 1px solid $color-link-primary;
                color: $white;

            }
        }

        .blocking-flag {
            label {
                align-self: stretch;
                display: block;
            }
            input:checked+label {
                background: $red;
                border: 1px solid $red;
                color: $white;
            }
        }
        input {
            display: none;
        }
    }
    .attachments {
        margin-bottom: 0;
    }
    .attachment-body {
        max-height: 7.5rem;
        overflow-y: auto;
    }
    .attachment-delete {
        right: .5rem;
        svg {
            fill: $color-link-tertiary;
        }
        &:hover {
            cursor: pointer;
            svg {
                fill: $color-link-red;
            }
        }
    }
}

.lightbox-generic-bulk {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }
    textarea {
        max-height: 12rem;
        min-height: 15rem;
    }
    .creation-position-fields {
        .custom-radio {
            margin-inline-end: .5rem;
        }
    }
    .swimlane-select {
        margin-block-end: 1rem;
    }
    .label {
        @include font-size(xsmall);
        @include font-type(medium);
        color: $color-black900;
        display: block;
        margin-block-end: .25rem;
        text-transform: uppercase;
    }
    .lb-action-wrapper {
        display: flex;
        justify-content: flex-end;
    }
    .bulk-status-selector-wrapper {
        position: relative;
    }
    .bulk-status-selector {
        @include font-size(small);
        border: 2px solid transparent;
        border-radius: 3px;
        color: $color-white;
        display: flex;
        justify-content: space-between;
        padding: .25rem 1rem;
        width: 100%;
        &.active {
            border: 2px solid $color-link-tertiary;
        }
        .icon {
            fill: currentColor;
        }
    }
    .bulk-status-option-wrapper {
        background-color: $color-white;
        border: 1px solid $color-gray400;
        border-radius: 4px;
        box-shadow: 4px 4px 8px rgba($color-gray400, .5);
        padding: .5rem;
        position: absolute;
        // Calc font + padding + borders
        top: calc(1.5rem + 4px);
        width: 100%;
        z-index: $first-layer;
    }
    .bulk-status-option {
        @include font-size(small);
        background: transparent;
        color: $color-link-primary;
        cursor: pointer;
        display: block;
        padding: .25rem;
        text-align: left;
        width: 100%;

        &:hover {
            background: $color-gray200;
        }

        &.selected {
            color: $color-link-tertiary;
        }
    }
}

.lightbox-search {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }
    fieldset {
        margin-bottom: 1rem;
    }
}
.lightbox-sprint-add-edit {
    form {
        flex-basis: 600px;
        flex-flow: 0;
        max-width: 600px;
    }
    .last-sprint-name {
        @include font-size(small);
        color: $gray;
        opacity: 1;
        position: absolute;
        right: 1rem;
        top: .5rem;
        transition: opacity .3s linear;
        &.disappear {
            opacity: 0;
            transition: opacity .3s linear;
        }
    }
    .dates {
        margin-bottom: 1rem;
        div {
            float: left;
            margin-right: 1%;
            position: relative;
            width: 49%;
            &:last-child {
                margin: 0;
                width: 50%;
            }
        }
    }
    .delete-sprint {
        @include font-size(small);
        color: $color-link-primary;
        display: flex;
        transition: color .3s linear;
        .delete-sprint-text {
            margin: .1rem 0 0 .25rem;
        }
        .icon {
            fill: currentColor;
        }
        &:hover {
            color: $red;
            transition: color .3s linear;
            .icon {
                fill: currentColor;
            }
        }
    }
    .sprint-add-edit-actions {
        align-items: center;
        display: flex;
        justify-content: space-between;
    }
}

.lightbox-generic-ask {
    form {
        flex-basis: 420px;
        flex-flow: 0;
        max-width: 420px;
    }
    .subtitle,
    .message {
        display: block;
        line-height: 1.5rem;
        margin: 1rem 0;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(regular);
        white-space: pre-line;
    }
    .options {
        align-items: center;
        display: flex;
        justify-content: space-around;
    }
}

.lightbox-generic-delete {
    form {
        flex-basis: 420px;
        flex-flow: 0;
        max-width: 420px;
    }
    .subtitle,
    .message {
        @include font-size(large);
        display: block;
        line-height: 1.5rem;
        margin: 1rem 0;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(regular);
        white-space: pre-line;
    }
    .options {
        align-items: center;
        display: flex;
        justify-content: center;
    }
    .btn-link {
        margin-right: 2rem;
        padding: .25rem 2rem;
    }
}

.lightbox-ask-choice {
    text-align: center;
    form {
        flex-basis: 420px;
        flex-grow: 0;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 1.5rem;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(regular);
    }
    .replacement {
        display: block;
        span {
            display: block;
        }
    }
    .choices {
        margin-bottom: 2rem;
    }
    .options {
        align-items: center;
        display: flex;
        justify-content: space-between;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
    .warning {
        @include font-type(medium);
    }
}

.lightbox-delete-account {
    p {
        text-align: center;
    }
    form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 2rem;
        text-align: center;
    }
    .newsletter {
        margin: 1rem 0;
        text-align: center;
        input {
            margin-right: .5rem;
            +label {
                @include font-size(small);
                @include font-type(regular);
            }
        }
    }
    .options {
        display: flex;
        justify-content: space-between;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
}

.lightbox-delete-project {
    form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 2rem;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(regular);
    }
    .options {
        display: flex;
        justify-content: space-between;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
}


.lightbox-generic-success,
.lightbox-generic-error,
.lightbox-generic-loading {
    section {
        flex-basis: 500px;
        flex-grow: 0;
        flex-shrink: 0;
        width: 500px;
    }
    h2 {
        line-height: 2rem;
    }
    p {
        text-align: center;
    }
    .message {
        margin: 0 auto;
        max-width: 300px;
    }
    .options {
        display: flex;
        justify-content: center;
        margin-top: 2rem;
    }
}

.lightbox-generic-loading {
    .spin {
        margin: 1rem auto;
        width: 5rem;
        img {
            @include loading-spinner;
            max-height: 100%;
            max-width: 100%;
            width: 100%;
        }
    }
    .progress-bar-wrapper {
        background: darken($whitish, 5%);
        height: 30px;
        margin-bottom: 1rem;
        padding: 3px;
        position: relative;
        .bar {
            background: $primary-light;
            height: 24px;
            position: absolute;
            transition: width .1s linear;
        }
        .progress {
            @include font-type(regular);
            @include font-type(medium);
            @include font-size(large);
            background: darken($whitish, 5%);
            bottom: 35px;
            color: $gray;
            padding: .3rem;
            position: absolute;
            transition: left .1s linear;
        }
    }
}

.lightbox-create-issue {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        width: 600px;
    }

    .fieldset-row {
        display: flex;
        fieldset {
            flex-basis: 100px;
            flex-grow: 1;
            margin-right: .5rem;
            width: 30%;
            &:last-child {
                margin: 0;
            }
        }
    }

    textarea {
        margin-bottom: 1rem;
        max-height: 12rem;
        min-height: 8rem;
    }
}

.lightbox-block {
    .form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    textarea {
        margin-bottom: 1rem;
        max-height: 12rem;
        min-height: 8rem;
    }
    .button-block {
        width: 100%;
    }
}

.lightbox-select-user {
    .form {
        flex-basis: 600px;
        flex-grow: 0;
        width: 600px;
    }
    .search {
        margin-top: 2rem;
    }
    .user-list-single {
        &:hover,
        &.selected {
            background: rgba(lighten($primary-light, 30%), .3);
            cursor: pointer;
        }
        &:hover {
            transition: background .3s linear;
            transition-delay: .2s;
        }
    }
    .more-watchers {
        @include font-type(regular);
        @include font-size(medium);
        padding: .5rem;
        text-align: center;
    }
    .btn-big.btn-big-full {
        width: 100%;
    }
    .add-comment {
        padding: 1rem 0;
        position: relative;
        text-align: center;
        .icon-close {
            cursor: pointer;
            fill: $gray;
            position: absolute;
            right: 0;
            top: 0;
            transition: fill .2s;
            &:hover {
                fill: $red-light;
            }
            svg {
                @include svg-size(2rem);
            }
        }
        fieldset {
            margin: 0;
        }
        textarea {
            margin-top: 1rem;
        }
        a {
            color: $color-link-primary;
        }
    }
}

.lb-create-edit-userstory {
    .points-per-role {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0;
    }
    .ticket-role-points {
        margin: .1rem;
        min-width: 20%;
        &:first-child {
            margin-left: 0;
        }
        &:nth-child(4n + 4) {
            margin-right: 0;
        }
        &:last-child {
            flex-basis: 100%;
            margin: .1rem 0;
            min-width: 100%;
        }
    }
}

.lightbox-import-error {
    text-align: center;
    .content {
        width: 500px;
    }
    h2 {
        margin-top: 1rem;
    }
    .description {
        a {
            color: $color-link-primary;
        }
    }
    img {
        height: 5rem;
    }
}

.lightbox-leave-project-warning {
    text-align: center;
    .icon {
        fill: $gray-light;
        height: 3rem;
        margin-bottom: 1rem;
        width: 3rem;
    }
    .content {
        width: 500px;
    }
    .btn-big {
        color: $color-black900;
        &:hover {
            color: $color-white;
        }
    }
}

.lightbox-request-ownership {
    text-align: center;
    .content {
        width: 500px;
    }
}

.lightbox-set-due-date {
    z-index: $loading-layer;
    form {
        flex-basis: 600px;
        flex-flow: 0;
        max-width: 600px;
    }
    .date {
        margin: 2rem 0 1rem;
    }
    .reason textarea {
        margin-top: .5rem;
    }
    .due-date-suggestions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin: 1rem 0 .5rem;
    }
    .suggestion {
        background: rgba($gray-lighter, .2);
        color: $gray-lighter;
        justify-content: flex-start;
        margin: 0 .5rem .5rem;
        min-height: 2rem;
        padding: .5rem .75rem;
        position: relative;
        &:first-child {
            margin-left: 0;
        }
        &:nth-child(4n + 4) {
            margin-right: 0;
        }
        &.clickable {
            &:hover,
            &.active {
                background: rgba($primary-light, .9);
                color: $white;
            }
        }
    }
    .delete-due-date {
        @include font-size(small);
        color: $gray;
        float: right;
        margin: 1rem .25rem 0 0;
        transition: color .3s linear;
        .icon {
            fill: currentColor;
        }
        &:hover {
            color: $red;
            transition: color .3s linear;
            .icon {
                fill: currentColor;
            }
        }
    }
}

.lightbox-create-edit {
    z-index: $overall-layer;
    $control-height: 2rem;
    $spacing: 1rem;
    $width: 700px;
    $pop-width: 203px;
    $sidebar-width: calc(200px + 2rem);
    form {
        flex-basis: $width;
        max-width: $width;
        width: $width;
    }
    label {
        @include font-size(small);
        color: $color-link-primary;
        padding-left: .25rem;
    }
    textarea {
        min-height: 13rem;
    }
    .creation-position-fields {
        justify-content: space-between;
        padding-right: .2rem;
    }
    .form-wrapper {
        display: flex;
        margin-bottom: $spacing;
        width: $width;
        .sidebar {
            background: none;
            flex-basis: $sidebar-width;
            flex-shrink: 0;
            margin-left: $spacing;
            min-width: $sidebar-width;
            padding-left: $spacing;
            width: $sidebar-width;
        }
    }
    .existing-item-wrapper {
        margin-bottom: $spacing * 2;
        select .strong {
            @include font-type(medium);
        }
    }
    .add-existing-button,
    .add-item {
        width: 100%;
    }
    .status-button {
        display: flex;
        position: relative;
    }
    .status-dropdown {
        align-content: center;
        border-radius: 3px;
        color: $color-white;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        padding: .5rem .75rem;
        width: 100%;
        svg {
            fill: $color-white;
            height: .9rem;
            width: .9rem;
        }
    }

    .assigned-inline {
        position: relative;
        .user-list-avatar img {
            height: 3rem;
            width: 3rem;
        }
    }

    .ticket-assigned-to {
        border: 0;
        margin: 0 0 1rem;
        padding: 0;
        &.multiple-assign {
            align-items: start;
            flex-direction: column;
        }
        .assigned-to-actions {
            display: block;
        }
        .remove-user {
            top: 1.2rem;
        }
    }

    .user-list {
        display: flex;
        width: 100%;
        $item-size: 44.75px;
        .user-list-item {
            margin-right: .5rem;
            width: $item-size;
            img {
                height: $item-size;
                width: $item-size;
            }
            &:last-child {
                margin-right: 0;
            }
            &.counter {
                background: $gray-lighter;
                color: $gray-light;
                font-weight: 400;
                height: $item-size;
                line-height: $item-size;
                text-align: center;
            }
        }
    }

    .ticket-user-list .remove-user {
        margin-right: 0;
    }

    .tg-add-assigned {
        align-items: center;
        display: flex;
        margin: .25rem 0 .75rem;
        .add-assigned {
            fill: $gray;
            opacity: 1;
            right: .5rem;
            top: 2rem;
            &:hover {
                cursor: pointer;
                fill: $red;
                transition: fill .2s;
            }
        }

        span {
            @include font-size(small);
            @include font-type(regular);
            color: $gray;
            margin: .2rem .5rem;
        }
    }

    .users-dropdown {
        position: relative;
    }

    .self-assign {
        display: block;
    }

    .pop-status {
        @include popover(
            $width: $pop-width,
            $top: 2rem
        );
    }

    .pop-users {
        @include popover(
            $width: $pop-width,
            $top: 60px,
            $left: 0,
            $arrow-width: 16px,
            $arrow-top: -10px,
            $arrow-left: calc($pop-width / 3)
        );
        &::after {
            z-index: $negative-layer;
        }
        &.multiple {
            top: 84px;
            &::after {
                left: 30px;
            }
        }
        ul {
            margin-bottom: .5rem;
        }
        li {
            border-bottom: 1px solid $gray-light;
            &:last-child {
                border: 0;
            }
        }
        .users-search {
            margin-bottom: .5rem;
        }
        .user-list-single {
            align-items: center;
            display: flex;
            height: auto;
            margin-bottom: .25rem;
            min-height: 2rem;
            padding: .25rem;
            tg-svg {
                display: none;
                flex: 0 0 auto;
            }

            &.selected {
                background: $color-gray200;
                .user-list-name {
                    color: $color-link-tertiary;
                }

                tg-svg {
                    display: flex;
                    fill: $color-link-tertiary;
                    margin-right: .5rem;
                }
            }

            &:hover {
                background: $color-gray200;
                .user-list-name {
                    color: $color-link-primary;
                }
                tg-svg {
                    fill: $color-link-primary;
                }
            }

            .user-list-avatar {
                border-radius: 50%;
                flex: 0 0 auto;
                height: 1.75rem;
                margin-right: .5rem;
                width: 1.75rem;
            }
            .user-list-name {
                @include font-type(regular);
                color: $color-black600;
                flex: 0 1 auto;
                flex-grow: 1;
                min-width: 0;
                overflow: hidden;
                position: relative;
                text-overflow: ellipsis;
                white-space: nowrap;

            }
        }

        .show-more {
            border-top: 1px solid $gray-light;
            padding-top: .5rem;
            text-align: center;
        }
    }
    .ticket-data {
        padding-top: 0;
    }

    .ticket-data-container {
        margin: 0;
        padding: 0 0 .1rem;
        .ticket-status .priority-data {
            margin: 0;
        }
    }

    .ticket-estimation .points-per-role {
        margin: 0;
    }

    .ticket-detail-settings {
        justify-content: left;
        margin: 1rem 0 0;
    }

    .blocked-note {
        margin-top: .5rem;
    }

    .btn-container {
        display: flex;
        justify-content: flex-end;
    }

}

.lightbox-create-edit,
.lightbox-generic-bulk {
    .swimlane-select,
    .creation-position {
        margin-block-end: 1rem;
        .label {
            @include font-size(xsmall);
            @include font-type(medium);
            color: $color-black900;
            display: block;
            margin-block-end: .25rem;
            text-transform: uppercase;
        }
    }
    .creation-position {
        $radio-size: 18px;

        label {
            @include font-size(small);
            color: $color-gray800;
        }
        input[type='radio'] {
            height: 0;
            opacity: 0;
            width: 0;

            &:checked ~ .radio-label {
                color: $color-link-primary;
            }
            &:checked + .radio-control::before {
                transform: scale(1);
            }
        }
        .custom-radio {
            align-self: center;
            display: flex;
        }
        .radio-control {
            border: 2px solid $color-gray400;
            border-radius: 50%;
            display: grid;
            height: $radio-size;
            margin-inline-end: .25rem;
            place-items: center;
            transform: translateY(-.06rem);
            width: $radio-size;

            &::before {
                background-color: $color-link-primary;
                border-radius: 50%;
                content: '';
                display: block;
                height: ($radio-size / 2) - 1px;
                transform: scale(0);
                transition: 180ms transform ease-in-out;
                width: ($radio-size / 2) - 1px;
            }
        }
    }
    .creation-position-fields {
        display: flex;
    }
}

.ticket-detail-settings .lightbox-assign-sprint-to-issue {
    .lightbox-assign-related-sprint {
        width: 700px;
    }

    svg {
        fill: initial;
        max-height: initial;
        max-width: initial;
    }

    fieldset {
        label {
            background: none;
            display: inline-block;
            margin-bottom: .5rem;
            margin-right: 0;
            padding: 0;

            +input {
                display: initial;
            }
        }
    }

    button {
        width: 100%;
    }
}


.lightbox-relate-to-epic {
    .lightbox-create-related-epic-wrapper {
        max-width: 600px;
        width: 90%;
    }
    .related-with-selector {
        display: flex;
        margin-bottom: 1rem;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                transition: background .2s ease-in;
            }
            &:checked+label:hover {
                background: $primary-light;
            }
            +label {
                background: rgba($whitish, .7);
                cursor: pointer;
                display: block;
                padding: 2rem 1rem;
                text-align: center;
                text-transform: uppercase;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: rgba($primary-light, .3);
                transition: background .2s ease-in;
            }
        }
        .related-with-selector-single {
            flex: 1;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
    fieldset {
        label {
            display: inline-block;
            margin-bottom: .5rem;
        }
    }
    .new-epic-title {
        align-items: flex-end;
        display: flex;
    }
    .existing-epic-form,
    .new-epic-form {
        margin-bottom: 1rem;
    }
    .no-epics-found {
        padding: 1rem 0 0;
    }
    .new-epic-options {
        display: flex;
        margin-left: auto;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                fill: $white;
                transition: background .2s ease-in;
            }
            +label {
                background: $mass-white;
                color: $grayer;
                cursor: pointer;
                display: block;
                padding: .5rem;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: $primary-light;
                color: $white;
                fill: $white;
            }
        }
    }
    button {
        width: 100%;
    }
}

.lightbox-feedback {
    h2 {
        @include font-size(xlarge);
        @include font-type(bold);
        text-align: left;
    }

    textarea {
        height: 120px;
    }

    .title {
        text-align: left;
    }

    label {
        @include font-size(small);
        color: $color-black600;
        display: block;
        margin-bottom: .5rem;
        margin-left: .5rem;
        text-align: left;
    }
    fieldset {
        margin-bottom: .9rem;
    }
    .actions {
        display: flex;
        margin-bottom: 1rem;

        button {
            margin-left: auto;
        }
    }
    .can-also {
        background: $color-gray100;
        padding: 1rem;
        h3 {
            @include font-size(large);
            @include font-type(bold);
            color: $color-black900;
            margin-bottom: 1rem;
            text-align: left;
        }
        .text {
            @include font-size(small);
            color: $color-black600;
            margin-bottom: .5rem;
        }
    }
}
